package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.CompanyFindAllDao;
import com.cn.wanxi.dao.impl.CompanyFindAllImpl;
import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.CompanyFindAllService;
import redis.clients.jedis.Jedis;

public class CompanyFindAllServiceImpl implements CompanyFindAllService {
    @Override
    public ResultModel findAll(CompanyModel companyModel) {
        ResultModel resultModel = new ResultModel();
        CompanyFindAllDao companyFindAllDao = new CompanyFindAllImpl();
        CompanyModel model = companyFindAllDao.findCompany();

        Jedis jedis = new Jedis();
        jedis.set("logo", model.getLogo());
        jedis.set("phone", model.getPhone());
        jedis.set("ad", model.getAd());
        jedis.set("net", model.getNet());
        jedis.set("email", model.getEmail());
        jedis.set("version", model.getVersion());
        jedis.set("address", model.getAddress());
        jedis.set("advertisement", model.getAdvertisement());
        jedis.set("name", model.getName());


        resultModel.setData(model);
        return resultModel;
    }

    @Override
    public ResultModel add(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel findById(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel update(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel delete(CompanyModel companyModel) {
        return null;
    }

    @Override
    public ResultModel getCount(CompanyModel companyModel) {
        return null;
    }
}
